﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crawler;

namespace MainConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] url = new string[] { "http://public.ucn.dk/fen/testsite/", "http://google.com", "http://ucn.dk", "http://damolin.dk"};
            Console.WriteLine("Links:");
            for (int i = 0; i < url.Length; i++)
            {
                Console.WriteLine("  " + i + ": " + url[i]);
            }
            Console.WriteLine();


            Console.Write("Choose Link [0-"+ (url.Length - 1) +"]:");
            int link = int.Parse(Console.ReadLine());

            Console.WriteLine();
            
            Console.Write("Choose Level ['-1' for unlimited]");
            int level = int.Parse(Console.ReadLine());

            string selected = url[link];

            WebCrawler c = new WebCrawler();

            c.BuildGraph(selected, level);

            Console.WriteLine("\n\nDone Crawling, Outputting Graph as Tree:\n\n");
            Console.WriteLine(c.OutputGraph());

            Console.ReadLine();
        }
    }
}
